package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
	"zye8.15/models"
)

type MainController struct {
	beego.Controller
}

type Res struct {
	Cre  int
	Msg  string
	Data interface{}
}

func (c *MainController) List() {
	c.Ctx.Output.Header("Access-Control-Allow-Origin", "*")
	var data []models.Registered
	models.DB.Find(&data)
	c.Data["json"] = Res{200, "列表查询成功", data}
	c.ServeJSON(true)

}
